package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

@TableName("t_details")
public class OrderDetailBean {
    /**明细id */
    @TableId(value = "pk_detailId",type = IdType.AUTO)
    private Integer id;

    /**订单id */
    @TableField("fk_orderId")
    private Integer orderId;

    /**商品id */
    @TableField("fk_productId")
    private Integer productId;

    /**商品对象数量 */
    @TableField(exist = false)
    private ProductBean productBean;

    /**购买数量 */
    @TableField("d_buyNum")
    private Integer buyNum;

    public OrderDetailBean() {
    }

    public OrderDetailBean(Integer productId, Integer buyNum) {
        this.productId = productId;
        this.buyNum = buyNum;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getOrderId() {
        return orderId;
    }

    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    public Integer getProductId() {
        return productId;
    }

    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    public ProductBean getProductBean() {
        return productBean;
    }

    public void setProductBean(ProductBean productBean) {
        this.productBean = productBean;
    }

    public Integer getBuyNum() {
        return buyNum;
    }

    public void setBuyNum(Integer buyNum) {
        this.buyNum = buyNum;
    }

    @Override
    public String toString() {
        return "OrderDetail{" +
                "id=" + id +
                ", orderId=" + orderId +
                ", productId=" + productId +
                ", productBean=" + productBean +
                ", buyNum=" + buyNum +
                '}';
    }
}
